﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using WebUI.Controls;
using POSSystem.BLL;

namespace WebUI
{
    public partial class Refund : BasePage
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            base.Page_Load(sender, e);

            refundLookup.OnAddIMEI = RefundLookup_OnAddIMEI;
        }

        public void RefundLookup_OnAddIMEI(object sender, ListItemEventArgs e)
        {
            try
            {
                string imei = e.Data["IMEI"].ToString();
                string modelName = e.Data["ModelName"].ToString();
                int modelID = (int)e.Data["ModelID"];
                decimal price = (decimal)e.Data["Price"];
                refund.AddRefundIMEI(modelID, modelName, imei, price);
            }
            catch (Exception ex)
            {
                ErrorLog.WriteToFile("Refund.aspx.cs", "RefundLookup_OnAddIMEI", ex.StackTrace);
                ShowErrorMessage(panelErr, "(*) Error in add IMEI: " + ex.Message);
                updateErr.Update();
            }
        }
    }
}
